// ActionScript file
package AS3 {
import AS3.constants.combo.IndustrialEmissionReduction;
import AS3.constants.combo.TransportEmissionReduction;
import AS3.constants.combo.VehicleType;
import AS3.Country;

import mx.controls.Alert;

import mx.core.Application;
import mx.core.FlexGlobals;

import zakladki.AS3.VehicleSelectedData;

import zakladki.PrivateTransportPanel;

public class ButtonStatesController {
    /************************************************************************************
     Parametry kontrolek
     ************************************************************************************/
//								Mieszkanie
    private var cbHomeTypeMinMax:Array = new Array(0, 0);
    private var cbHomeMatMinMax:Array = new Array(0, 0);
    private var cbHomeInsulationMinMax:Array = new Array(0, 0);
    private var eHomeAreaMinMax:Array = new Array(0, 0);
    private var eHomePersonsMinMax:Array = new Array(0, 0);
    private var cbHeatTempMinMax:Array = new Array(0, 0);
    private var cbHeatSourceMinMax:Array = new Array(0, 0);
    private var cbVentillationMethodMinMax:Array = new Array(0, 0);
    private var seHeatRenewMinMax:Array = new Array(0, 0);
//								Ciepła woda
    private var seHotWatersBathsNoMinMax:Array = new Array(0, 0);
    private var cbHotWatersBathsWaterQtyMinMax:Array = new Array(0, 0);
    private var seHotWatersShowersNoMinMax:Array = new Array(0, 0);
    private var cbHotWatersHeatingSystemMinMax:Array = new Array(0, 0);
    private var chbKlimaMinMax:Array = new Array(0, 0);
    private var chbCarAirCondMinMax:Array = new Array(0, 0);
    private var cbKlimaTempMinMax:Array = new Array(0, 0);
// 							Transport Osobowy    

    private var cbCarSize1MinMax:Array = new Array(0, 0);
    private var eCarFuelCons1MinMax:Array = new Array(0, 0);
    private var cbCarSharnig1MinMax:Array = new Array(0, 0);
// 								Jedzenie
    private var cbFoodQuantityMinMax:Array = new Array(0, 0);
    private var cbFoodOriginMinMax:Array = new Array(0, 0);
    private var cbFoodMeatMinMax:Array = new Array(0, 0);
    private var cbFoodFrozenMinMax:Array = new Array(0, 0);
    private var cbFridgeMinMax:Array = new Array(0, 0);
    private var chbFreezerMinMax:Array = new Array(0, 0);
//								Konsumpcja
    private var cbFashionMinMax:Array = new Array(0, 0);
    private var cbPackagingMinMax:Array = new Array(0, 0);
    private var cbFurnitureMinMax:Array = new Array(0, 0);
    private var cbRecreationMinMax:Array = new Array(0, 0);
    private var cbElectricityMinMax:Array = new Array(0, 0);
    private var seElectrRenewMinMax:Array = new Array(0, 0);
    private var chbLightMinMax:Array = new Array(0, 0);
    private var chbWashingMachineMinMax:Array = new Array(0, 0);
    private var chbDryerMinMax:Array = new Array(0, 0);
    private var chbTVSetMinMax:Array = new Array(0, 0);
    private var chbVideoMinMax:Array = new Array(0, 0);
    private var chbCableTVMinMax:Array = new Array(0, 0);
    private var chbComputerMinMax:Array = new Array(0, 0);
    private var chbRadioMinMax:Array = new Array(0, 0);

    private var mainApp:Fossilminator = FlexGlobals.topLevelApplication as Fossilminator;

    /************************************************************************************
     Wczytanie początkowego stanu kontrolek
     ************************************************************************************/
    public function setControls(chosenCountry:Country, persons:Array, statisticMode:Boolean):void {
        var RX:Number, carDist:Number, flightHours:Number;

        mainApp.transport_osobowy_controls.changeViewFromParameters(new VehicleSelectedData(0,0,0,0,0,0,0),0);

        mainApp.transport_publiczny_controls.flightClass = 0;
        mainApp.konsumpcja_controls.income = 4;
        mainApp.konsumpcja_controls.recycling = 1;
        mainApp.ciepla_woda_controls.acFrequency = 0;
        mainApp.ciepla_woda_controls.acDuration = 0;
        mainApp.twoja_emisja_controls.energyProduction = 0;


        cbHomeTypeMinMax[1] = 1;
        cbHomeTypeMinMax[2] = 1;
        cbHomeMatMinMax[1] = 2;
        cbHomeMatMinMax[2] = 0;
        cbHomeInsulationMinMax[1] = 2;
        cbHomeInsulationMinMax[2] = 2;
        eHomeAreaMinMax[1] = 30;
        eHomeAreaMinMax[2] = 40;
        eHomePersonsMinMax[1] = 5;
        eHomePersonsMinMax[2] = 4;
        cbHeatTempMinMax[1] = 0;
        cbHeatTempMinMax[2] = 1;
        cbHeatSourceMinMax[1] = 6;
        cbHeatSourceMinMax[2] = 0;
        cbVentillationMethodMinMax[1] = 1;
        cbVentillationMethodMinMax[2] = 1;
        seHeatRenewMinMax[1] = 90;
        seHeatRenewMinMax[2] = 10;

        seHotWatersBathsNoMinMax[1] = 0;
        seHotWatersBathsNoMinMax[2] = 1;
        cbHotWatersBathsWaterQtyMinMax[1] = 1;
        cbHotWatersBathsWaterQtyMinMax[2] = 1;
        seHotWatersShowersNoMinMax[1] = 0;
        seHotWatersShowersNoMinMax[2] = 2;
        cbHotWatersHeatingSystemMinMax[1] = 6;
        cbHotWatersHeatingSystemMinMax[2] = 0;

        chbKlimaMinMax[1] = false;
        chbKlimaMinMax[2] = false;
        cbKlimaTempMinMax[1] = 3;
        cbKlimaTempMinMax[2] = 3;
        chbCarAirCondMinMax[1] = false;
        chbCarAirCondMinMax[2] = false;

        cbCarSize1MinMax[1] = 3;
        cbCarSize1MinMax[2] = 3;
        eCarFuelCons1MinMax[1] = 6;
        eCarFuelCons1MinMax[2] = 7;
        cbCarSharnig1MinMax[1] = 4;
        cbCarSharnig1MinMax[2] = 3;

        cbFoodQuantityMinMax[1] = 2;
        cbFoodQuantityMinMax[2] = 2;
        cbFoodOriginMinMax[1] = 0;
        cbFoodOriginMinMax[2] = 1;
        cbFoodMeatMinMax[1] = 1;
        cbFoodMeatMinMax[2] = 2;
        cbFoodFrozenMinMax[1] = 0;
        cbFoodFrozenMinMax[2] = 0;
        cbFridgeMinMax[1] = 0;
        cbFridgeMinMax[2] = 3;
        chbFreezerMinMax[1] = false;
        chbFreezerMinMax[2] = false;

        cbFashionMinMax[1] = 0;
        cbFashionMinMax[2] = 1;
        cbPackagingMinMax[1] = 0;
        cbPackagingMinMax[2] = 0;
        cbFurnitureMinMax[1] = 0;
        cbFurnitureMinMax[2] = 1;
        cbRecreationMinMax[1] = 0;
        cbRecreationMinMax[2] = 0;
        cbElectricityMinMax[1] = 0;
        cbElectricityMinMax[2] = 1;
        seElectrRenewMinMax[1] = 0;
        seElectrRenewMinMax[2] = 0;

        chbLightMinMax[1] = false;
        chbLightMinMax[2] = true;
        chbWashingMachineMinMax[1] = false;
        chbWashingMachineMinMax[2] = false;
        chbDryerMinMax[1] = false;
        chbDryerMinMax[2] = false;
        chbTVSetMinMax[1] = false;
        chbTVSetMinMax[2] = true;
        chbVideoMinMax[1] = false;
        chbVideoMinMax[2] = false;
        chbCableTVMinMax[1] = false;
        chbCableTVMinMax[2] = false;
        chbComputerMinMax[1] = false;
        chbComputerMinMax[2] = false;
        chbRadioMinMax[1] = false;
        chbRadioMinMax[2] = true;

        // Kraje ubogie - Indie, Chiny (400-1500)
        if ((chosenCountry.consumption2000 >= 400) && (chosenCountry.consumption2000 < 1500)) {
            IConsumption2000_400();
        }

        // (1500-3500) kraje na dorobku - Polska
        if ((chosenCountry.consumption2000 >= 1500) && (chosenCountry.consumption2000 < 3500)) {
            IConsumption2000_1500();
        }

        // (3500-10000) kraje dość bogate - Portugalia, Grecja
        if ((chosenCountry.consumption2000 >= 3500) && (chosenCountry.consumption2000 < 10000)) {
            IConsumption2000_3500();
        }

        // kraje bogate
        if ((chosenCountry.consumption2000 >= 10000) && (chosenCountry.consumption2000 < 25000)) {
            IConsumption2000_10000();
        }

        // kraje najbogatsze
        if (chosenCountry.consumption2000 >= 25000) {
            IConsumption2000_25000();
        }


        carDist = 16000 / 52; // Korekty załatwia krzywa Gompertza

        if (chosenCountry.nameEn == 'United States') {
            carDist = carDist * 1.8;
        }
        if (chosenCountry.nameEn == 'Canada') {
            carDist = carDist * 1.5;
        }
        if (chosenCountry.nameEn == 'Australia') {
            carDist = carDist * 1.2;
        }

        flightHours = 5 * chosenCountry.consumption2000 / 20000; // Dla 20000 5h w sumie - zależność liniowa


        for (var i:int = 0; i < persons.length; i++) {
            var person:Person = persons[i];
            if (statisticMode) {
                seHeatRenewMinMax[2] = 0;    // Wyłączamy  trzeba włączyć manualnie
                seElectrRenewMinMax[2] = 0; // Wyłączamy  trzeba włączyć manualnie
                chbKlimaMinMax[2] = false;   // Wyłączamy  trzeba włączyć manualnie

                person.longDistanceFlights = 0;
                person.shortDistanceFlights = Math.round(flightHours);
            }
            else {
                RX = Math.round(1.5 * chosenCountry.consumption2000 * Math.pow(10, -0.00006 * chosenCountry.consumption2000) / 52);
                person.longDistanceBus = Math.round(100 * RX);
                person.suburbanTrain = Math.round(100 * RX / 2);

                carDist = carDist * 100;

                person.longDistanceFlights = Math.round(flightHours * 100 / 2);
                person.shortDistanceFlights = Math.round(flightHours * 100 / 2);
            }

            person.getVehicleData(0).distancePerWeek = Math.round(carDist);
        }
    }

    /*************************************************************************************
     Funkcje ustawiające parametry min max w zależności od IConsumption2000
     *************************************************************************************/
    private function IConsumption2000_25000():void {
        cbHomeTypeMinMax[1] = cbHomeTypeMinMax[2];
        cbHomeTypeMinMax[2] = 1;
        cbHomeMatMinMax[1] = cbHomeMatMinMax[2];
        cbHomeMatMinMax[2] = 0;
        cbHomeInsulationMinMax[1] = cbHomeInsulationMinMax[2];
        cbHomeInsulationMinMax[2] = 3;
        eHomeAreaMinMax[1] = eHomeAreaMinMax[2];
        eHomeAreaMinMax[2] = 150;
        eHomePersonsMinMax[1] = eHomePersonsMinMax[2];
        eHomePersonsMinMax[2] = 3;
        cbHeatTempMinMax[1] = cbHeatTempMinMax[2];
        cbHeatTempMinMax[2] = 3;
        cbHeatSourceMinMax[1] = cbHeatSourceMinMax[2];
        cbHeatSourceMinMax[2] = 0;
        cbVentillationMethodMinMax[1] = cbVentillationMethodMinMax[2];
        cbVentillationMethodMinMax[2] = 1;
        seHeatRenewMinMax[1] = seHeatRenewMinMax[2];
        seHeatRenewMinMax[2] = 10;

        seHotWatersBathsNoMinMax[1] = seHotWatersBathsNoMinMax[2];
        seHotWatersBathsNoMinMax[2] = 7;
        cbHotWatersBathsWaterQtyMinMax[1] = cbHotWatersBathsWaterQtyMinMax[2];
        cbHotWatersBathsWaterQtyMinMax[2] = 8; // Baseny
        seHotWatersShowersNoMinMax[1] = seHotWatersShowersNoMinMax[2];
        seHotWatersShowersNoMinMax[2] = 0;
        cbHotWatersHeatingSystemMinMax[1] = cbHotWatersHeatingSystemMinMax[2];
        cbHotWatersHeatingSystemMinMax[2] = 0;

        chbKlimaMinMax[1] = chbKlimaMinMax[2];
        chbKlimaMinMax[2] = true;
        cbKlimaTempMinMax[1] = cbKlimaTempMinMax[2];
        cbKlimaTempMinMax[2] = 0;
        chbCarAirCondMinMax[1] = chbCarAirCondMinMax[2];
        chbCarAirCondMinMax[2] = true;

        cbCarSize1MinMax[1] = cbCarSize1MinMax[2];
        cbCarSize1MinMax[2] = 5;
        eCarFuelCons1MinMax[1] = eCarFuelCons1MinMax[2];
        eCarFuelCons1MinMax[2] = 14;
        cbCarSharnig1MinMax[1] = cbCarSharnig1MinMax[2];
        cbCarSharnig1MinMax[2] = 1;

        cbFoodQuantityMinMax[1] = cbFoodQuantityMinMax[2];
        cbFoodQuantityMinMax[2] = 3;
        cbFoodOriginMinMax[1] = cbFoodOriginMinMax[2];
        cbFoodOriginMinMax[2] = 3;
        cbFoodMeatMinMax[1] = cbFoodMeatMinMax[2];
        cbFoodMeatMinMax[2] = 3;
        cbFoodFrozenMinMax[1] = cbFoodFrozenMinMax[2];
        cbFoodFrozenMinMax[2] = 2;
        cbFridgeMinMax[1] = cbFridgeMinMax[2];
        cbFridgeMinMax[2] = 3;
        chbFreezerMinMax[1] = chbFreezerMinMax[2];
        chbFreezerMinMax[2] = true;

        cbFashionMinMax[1] = cbFashionMinMax[2];
        cbFashionMinMax[2] = 2;
        cbPackagingMinMax[1] = cbPackagingMinMax[2];
        cbPackagingMinMax[2] = 2;
        cbFurnitureMinMax[1] = cbFurnitureMinMax[2];
        cbFurnitureMinMax[2] = 2;
        cbRecreationMinMax[1] = cbRecreationMinMax[2];
        cbRecreationMinMax[2] = 1;
        cbElectricityMinMax[1] = cbElectricityMinMax[2];
        cbElectricityMinMax[2] = 1;
        seElectrRenewMinMax[1] = seElectrRenewMinMax[2];
        seElectrRenewMinMax[2] = 0;

        chbLightMinMax[1] = chbLightMinMax[2];
        chbLightMinMax[2] = true;
        chbWashingMachineMinMax[1] = chbWashingMachineMinMax[2];
        chbWashingMachineMinMax[2] = true;
        chbDryerMinMax[1] = chbDryerMinMax[2];
        chbDryerMinMax[2] = true;
        chbTVSetMinMax[1] = chbTVSetMinMax[2];
        chbTVSetMinMax[2] = true;
        chbVideoMinMax[1] = chbVideoMinMax[2];
        chbVideoMinMax[2] = true;
        chbCableTVMinMax[1] = chbCableTVMinMax[2];
        chbCableTVMinMax[2] = true;
        chbComputerMinMax[1] = chbComputerMinMax[2];
        chbComputerMinMax[2] = true;
        chbRadioMinMax[1] = chbRadioMinMax[2];
        chbRadioMinMax[2] = true;
    }

    private function IConsumption2000_10000():void {
        cbHomeTypeMinMax[1] = cbHomeTypeMinMax[2];
        cbHomeTypeMinMax[2] = 1;
        cbHomeMatMinMax[1] = cbHomeMatMinMax[2];
        cbHomeMatMinMax[2] = 0;
        cbHomeInsulationMinMax[1] = cbHomeInsulationMinMax[2];
        cbHomeInsulationMinMax[2] = 3;
        eHomeAreaMinMax[1] = eHomeAreaMinMax[2];
        eHomeAreaMinMax[2] = 100;
        eHomePersonsMinMax[1] = eHomePersonsMinMax[2];
        eHomePersonsMinMax[2] = 3;
        cbHeatTempMinMax[1] = cbHeatTempMinMax[2];
        cbHeatTempMinMax[2] = 2;
        cbHeatSourceMinMax[1] = cbHeatSourceMinMax[2];
        cbHeatSourceMinMax[2] = 0;
        cbVentillationMethodMinMax[1] = cbVentillationMethodMinMax[2];
        cbVentillationMethodMinMax[2] = 1;
        seHeatRenewMinMax[1] = seHeatRenewMinMax[2];
        seHeatRenewMinMax[2] = 10;

        seHotWatersBathsNoMinMax[1] = seHotWatersBathsNoMinMax[2];
        seHotWatersBathsNoMinMax[2] = 7;
        cbHotWatersBathsWaterQtyMinMax[1] = cbHotWatersBathsWaterQtyMinMax[2];
        cbHotWatersBathsWaterQtyMinMax[2] = 3;
        seHotWatersShowersNoMinMax[1] = seHotWatersShowersNoMinMax[2];
        seHotWatersShowersNoMinMax[2] = 0;
        cbHotWatersHeatingSystemMinMax[1] = cbHotWatersHeatingSystemMinMax[2];
        cbHotWatersHeatingSystemMinMax[2] = 0;

        chbKlimaMinMax[1] = chbKlimaMinMax[2];
        chbKlimaMinMax[2] = true;
        cbKlimaTempMinMax[1] = cbKlimaTempMinMax[2];
        cbKlimaTempMinMax[2] = 2;
        chbCarAirCondMinMax[1] = chbCarAirCondMinMax[2];
        chbCarAirCondMinMax[2] = true;

        cbCarSize1MinMax[1] = cbCarSize1MinMax[2];
        cbCarSize1MinMax[2] = 4;
        eCarFuelCons1MinMax[1] = eCarFuelCons1MinMax[2];
        eCarFuelCons1MinMax[2] = 11;
        cbCarSharnig1MinMax[1] = cbCarSharnig1MinMax[2];
        cbCarSharnig1MinMax[2] = 1;

        cbFoodQuantityMinMax[1] = cbFoodQuantityMinMax[2];
        cbFoodQuantityMinMax[2] = 2;
        cbFoodOriginMinMax[1] = cbFoodOriginMinMax[2];
        cbFoodOriginMinMax[2] = 3;
        cbFoodMeatMinMax[1] = cbFoodMeatMinMax[2];
        cbFoodMeatMinMax[2] = 3;
        cbFoodFrozenMinMax[1] = cbFoodFrozenMinMax[2];
        cbFoodFrozenMinMax[2] = 2;
        cbFridgeMinMax[1] = cbFridgeMinMax[2];
        cbFridgeMinMax[2] = 3;
        chbFreezerMinMax[1] = chbFreezerMinMax[2];
        chbFreezerMinMax[2] = true;

        cbFashionMinMax[1] = cbFashionMinMax[2];
        cbFashionMinMax[2] = 2;
        cbPackagingMinMax[1] = cbPackagingMinMax[2];
        cbPackagingMinMax[2] = 1;
        cbFurnitureMinMax[1] = cbFurnitureMinMax[2];
        cbFurnitureMinMax[2] = 2;
        cbRecreationMinMax[1] = cbRecreationMinMax[2];
        cbRecreationMinMax[2] = 1;
        cbElectricityMinMax[1] = cbElectricityMinMax[2];
        cbElectricityMinMax[2] = 1;
        seElectrRenewMinMax[1] = seElectrRenewMinMax[2];
        seElectrRenewMinMax[2] = 0;

        chbLightMinMax[1] = chbLightMinMax[2];
        chbLightMinMax[2] = true;
        chbWashingMachineMinMax[1] = chbWashingMachineMinMax[2];
        chbWashingMachineMinMax[2] = true;
        chbDryerMinMax[1] = chbDryerMinMax[2];
        chbDryerMinMax[2] = false;
        chbTVSetMinMax[1] = chbTVSetMinMax[2];
        chbTVSetMinMax[2] = true;
        chbVideoMinMax[1] = chbVideoMinMax[2];
        chbVideoMinMax[2] = true;
        chbCableTVMinMax[1] = chbCableTVMinMax[2];
        chbCableTVMinMax[2] = true;
        chbComputerMinMax[1] = chbComputerMinMax[2];
        chbComputerMinMax[2] = true;
        chbRadioMinMax[1] = chbRadioMinMax[2];
        chbRadioMinMax[2] = true;
    }

    private function IConsumption2000_3500():void {
        cbHomeTypeMinMax[1] = cbHomeTypeMinMax[2];
        cbHomeTypeMinMax[2] = 2;
        cbHomeMatMinMax[1] = cbHomeMatMinMax[2];
        cbHomeMatMinMax[2] = 0;
        cbHomeInsulationMinMax[1] = cbHomeInsulationMinMax[2];
        cbHomeInsulationMinMax[2] = 2;
        eHomeAreaMinMax[1] = eHomeAreaMinMax[2];
        eHomeAreaMinMax[2] = 100;
        eHomePersonsMinMax[1] = eHomePersonsMinMax[2];
        eHomePersonsMinMax[2] = 3;
        cbHeatTempMinMax[1] = cbHeatTempMinMax[2];
        cbHeatTempMinMax[2] = 2;
        cbHeatSourceMinMax[1] = cbHeatSourceMinMax[2];
        cbHeatSourceMinMax[2] = 0;
        cbVentillationMethodMinMax[1] = cbVentillationMethodMinMax[2];
        cbVentillationMethodMinMax[2] = 1;
        seHeatRenewMinMax[1] = seHeatRenewMinMax[2];
        seHeatRenewMinMax[2] = 8;

        seHotWatersBathsNoMinMax[1] = seHotWatersBathsNoMinMax[2];
        seHotWatersBathsNoMinMax[2] = 7;
        cbHotWatersBathsWaterQtyMinMax[1] = cbHotWatersBathsWaterQtyMinMax[2];
        cbHotWatersBathsWaterQtyMinMax[2] = 3;
        seHotWatersShowersNoMinMax[1] = seHotWatersShowersNoMinMax[2];
        seHotWatersShowersNoMinMax[2] = 0;
        cbHotWatersHeatingSystemMinMax[1] = cbHotWatersHeatingSystemMinMax[2];
        cbHotWatersHeatingSystemMinMax[2] = 0;

        chbKlimaMinMax[1] = chbKlimaMinMax[2];
        chbKlimaMinMax[2] = true;
        cbKlimaTempMinMax[1] = cbKlimaTempMinMax[2];
        cbKlimaTempMinMax[2] = 4;
        chbCarAirCondMinMax[1] = chbCarAirCondMinMax[2];
        chbCarAirCondMinMax[2] = false;

        cbCarSize1MinMax[1] = cbCarSize1MinMax[2];
        cbCarSize1MinMax[2] = 4;
        eCarFuelCons1MinMax[1] = eCarFuelCons1MinMax[2];
        eCarFuelCons1MinMax[2] = 9;
        cbCarSharnig1MinMax[1] = cbCarSharnig1MinMax[2];
        cbCarSharnig1MinMax[2] = 2;

        cbFoodQuantityMinMax[1] = cbFoodQuantityMinMax[2];
        cbFoodQuantityMinMax[2] = 2;
        cbFoodOriginMinMax[1] = cbFoodOriginMinMax[2];
        cbFoodOriginMinMax[2] = 3;
        cbFoodMeatMinMax[1] = cbFoodMeatMinMax[2];
        cbFoodMeatMinMax[2] = 2;
        cbFoodFrozenMinMax[1] = cbFoodFrozenMinMax[2];
        cbFoodFrozenMinMax[2] = 2;
        cbFridgeMinMax[1] = cbFridgeMinMax[2];
        cbFridgeMinMax[2] = 3;
        chbFreezerMinMax[1] = chbFreezerMinMax[2];
        chbFreezerMinMax[2] = false;

        cbFashionMinMax[1] = cbFashionMinMax[2];
        cbFashionMinMax[2] = 1;
        cbPackagingMinMax[1] = cbPackagingMinMax[2];
        cbPackagingMinMax[2] = 1;
        cbFurnitureMinMax[1] = cbFurnitureMinMax[2];
        cbFurnitureMinMax[2] = 1;
        cbRecreationMinMax[1] = cbRecreationMinMax[2];
        cbRecreationMinMax[2] = 1;
        cbElectricityMinMax[1] = cbElectricityMinMax[2];
        cbElectricityMinMax[2] = 1;
        seElectrRenewMinMax[1] = seElectrRenewMinMax[2];
        seElectrRenewMinMax[2] = 0;

        chbLightMinMax[1] = chbLightMinMax[2];
        chbLightMinMax[2] = true;
        chbWashingMachineMinMax[1] = chbWashingMachineMinMax[2];
        chbWashingMachineMinMax[2] = true;
        chbDryerMinMax[1] = chbDryerMinMax[2];
        chbDryerMinMax[2] = false;
        chbTVSetMinMax[1] = chbTVSetMinMax[2];
        chbTVSetMinMax[2] = true;
        chbVideoMinMax[1] = chbVideoMinMax[2];
        chbVideoMinMax[2] = true;
        chbCableTVMinMax[1] = chbCableTVMinMax[2];
        chbCableTVMinMax[2] = true;
        chbComputerMinMax[1] = chbComputerMinMax[2];
        chbComputerMinMax[2] = true;
        chbRadioMinMax[1] = chbRadioMinMax[2];
        chbRadioMinMax[2] = true;
    }

    private function IConsumption2000_1500():void {
        cbHomeTypeMinMax[1] = cbHomeTypeMinMax[2];
        cbHomeTypeMinMax[2] = 1;
        cbHomeMatMinMax[1] = cbHomeMatMinMax[2];
        cbHomeMatMinMax[2] = 0;
        cbHomeInsulationMinMax[1] = cbHomeInsulationMinMax[2];
        cbHomeInsulationMinMax[2] = 2;
        eHomeAreaMinMax[1] = eHomeAreaMinMax[2];
        eHomeAreaMinMax[2] = 55;
        eHomePersonsMinMax[1] = eHomePersonsMinMax[2];
        eHomePersonsMinMax[2] = 3;
        cbHeatTempMinMax[1] = cbHeatTempMinMax[2];
        cbHeatTempMinMax[2] = 2;
        cbHeatSourceMinMax[1] = cbHeatSourceMinMax[2];
        cbHeatSourceMinMax[2] = 0;
        cbVentillationMethodMinMax[1] = cbVentillationMethodMinMax[2];
        cbVentillationMethodMinMax[2] = 1;
        seHeatRenewMinMax[1] = seHeatRenewMinMax[2];
        seHeatRenewMinMax[2] = 3;

        seHotWatersBathsNoMinMax[1] = seHotWatersBathsNoMinMax[2];
        seHotWatersBathsNoMinMax[2] = 4;
        cbHotWatersBathsWaterQtyMinMax[1] = cbHotWatersBathsWaterQtyMinMax[2];
        cbHotWatersBathsWaterQtyMinMax[2] = 2;
        seHotWatersShowersNoMinMax[1] = seHotWatersShowersNoMinMax[2];
        seHotWatersShowersNoMinMax[2] = 3;
        cbHotWatersHeatingSystemMinMax[1] = cbHotWatersHeatingSystemMinMax[2];
        cbHotWatersHeatingSystemMinMax[2] = 0;

        chbKlimaMinMax[1] = chbKlimaMinMax[2];
        chbKlimaMinMax[2] = false;
        cbKlimaTempMinMax[1] = cbKlimaTempMinMax[2];
        cbKlimaTempMinMax[2] = 3;
        chbCarAirCondMinMax[1] = chbCarAirCondMinMax[2];
        chbCarAirCondMinMax[2] = false;

        cbCarSize1MinMax[1] = cbCarSize1MinMax[2];
        cbCarSize1MinMax[2] = 4;
        eCarFuelCons1MinMax[1] = eCarFuelCons1MinMax[2];
        eCarFuelCons1MinMax[2] = 8;
        cbCarSharnig1MinMax[1] = cbCarSharnig1MinMax[2];
        cbCarSharnig1MinMax[2] = 2;

        cbFoodQuantityMinMax[1] = cbFoodQuantityMinMax[2];
        cbFoodQuantityMinMax[2] = 2;
        cbFoodOriginMinMax[1] = cbFoodOriginMinMax[2];
        cbFoodOriginMinMax[2] = 2;
        cbFoodMeatMinMax[1] = cbFoodMeatMinMax[2];
        cbFoodMeatMinMax[2] = 2;
        cbFoodFrozenMinMax[1] = cbFoodFrozenMinMax[2];
        cbFoodFrozenMinMax[2] = 1;
        cbFridgeMinMax[1] = cbFridgeMinMax[2];
        cbFridgeMinMax[2] = 3;
        chbFreezerMinMax[1] = chbFreezerMinMax[2];
        chbFreezerMinMax[2] = false;

        cbFashionMinMax[1] = cbFashionMinMax[2];
        cbFashionMinMax[2] = 1;
        cbPackagingMinMax[1] = cbPackagingMinMax[2];
        cbPackagingMinMax[2] = 1;
        cbFurnitureMinMax[1] = cbFurnitureMinMax[2];
        cbFurnitureMinMax[2] = 0;
        cbRecreationMinMax[1] = cbRecreationMinMax[2];
        cbRecreationMinMax[2] = 1;
        cbElectricityMinMax[1] = cbElectricityMinMax[2];
        cbElectricityMinMax[2] = 1;
        seElectrRenewMinMax[1] = seElectrRenewMinMax[2];
        seElectrRenewMinMax[2] = 0;

        chbLightMinMax[1] = chbLightMinMax[2];
        chbLightMinMax[2] = true;
        chbWashingMachineMinMax[1] = chbWashingMachineMinMax[2];
        chbWashingMachineMinMax[2] = true;
        chbDryerMinMax[1] = chbDryerMinMax[2];
        chbDryerMinMax[2] = false;
        chbTVSetMinMax[1] = chbTVSetMinMax[2];
        chbTVSetMinMax[2] = true;
        chbVideoMinMax[1] = chbVideoMinMax[2];
        chbVideoMinMax[2] = true;
        chbCableTVMinMax[1] = chbCableTVMinMax[2];
        chbCableTVMinMax[2] = false;
        chbComputerMinMax[1] = chbComputerMinMax[2];
        chbComputerMinMax[2] = false;
        chbRadioMinMax[1] = chbRadioMinMax[2];
        chbRadioMinMax[2] = true;
    }

    private function IConsumption2000_400():void {
        cbHomeTypeMinMax[1] = cbHomeTypeMinMax[2];
        cbHomeTypeMinMax[2] = 1;
        cbHomeMatMinMax[1] = cbHomeMatMinMax[2];
        cbHomeMatMinMax[2] = 0;
        cbHomeInsulationMinMax[1] = cbHomeInsulationMinMax[2];
        cbHomeInsulationMinMax[2] = 2;
        eHomeAreaMinMax[1] = eHomeAreaMinMax[2];
        eHomeAreaMinMax[2] = 50;
        eHomePersonsMinMax[1] = eHomePersonsMinMax[2];
        eHomePersonsMinMax[2] = 4;
        cbHeatTempMinMax[1] = cbHeatTempMinMax[2];
        cbHeatTempMinMax[2] = 2;
        cbHeatSourceMinMax[1] = cbHeatSourceMinMax[2];
        cbHeatSourceMinMax[2] = 0;
        cbVentillationMethodMinMax[1] = cbVentillationMethodMinMax[2];
        cbVentillationMethodMinMax[2] = 1;
        seHeatRenewMinMax[1] = seHeatRenewMinMax[2];
        seHeatRenewMinMax[2] = 5;

        seHotWatersBathsNoMinMax[1] = seHotWatersBathsNoMinMax[2];
        seHotWatersBathsNoMinMax[2] = 3;
        cbHotWatersBathsWaterQtyMinMax[1] = cbHotWatersBathsWaterQtyMinMax[2];
        cbHotWatersBathsWaterQtyMinMax[2] = 2;
        seHotWatersShowersNoMinMax[1] = seHotWatersShowersNoMinMax[2];
        seHotWatersShowersNoMinMax[2] = 5;
        cbHotWatersHeatingSystemMinMax[1] = cbHotWatersHeatingSystemMinMax[2];
        cbHotWatersHeatingSystemMinMax[2] = 0;

        chbKlimaMinMax[1] = chbKlimaMinMax[2];
        chbKlimaMinMax[2] = false;
        cbKlimaTempMinMax[1] = cbKlimaTempMinMax[2];
        cbKlimaTempMinMax[2] = 3;
        chbCarAirCondMinMax[1] = chbCarAirCondMinMax[2];
        chbCarAirCondMinMax[2] = false;

        cbCarSize1MinMax[1] = cbCarSize1MinMax[2];
        cbCarSize1MinMax[2] = 4;
        eCarFuelCons1MinMax[1] = eCarFuelCons1MinMax[2];
        eCarFuelCons1MinMax[2] = 7;
        cbCarSharnig1MinMax[1] = cbCarSharnig1MinMax[2];
        cbCarSharnig1MinMax[2] = 3;

        cbFoodQuantityMinMax[1] = cbFoodQuantityMinMax[2];
        cbFoodQuantityMinMax[2] = 2;
        cbFoodOriginMinMax[1] = cbFoodOriginMinMax[2];
        cbFoodOriginMinMax[2] = 2;
        cbFoodMeatMinMax[1] = cbFoodMeatMinMax[2];
        cbFoodMeatMinMax[2] = 2;
        cbFoodFrozenMinMax[1] = cbFoodFrozenMinMax[2];
        cbFoodFrozenMinMax[2] = 1;
        cbFridgeMinMax[1] = cbFridgeMinMax[2];
        cbFridgeMinMax[2] = 3;
        chbFreezerMinMax[1] = chbFreezerMinMax[2];
        chbFreezerMinMax[2] = false;

        cbFashionMinMax[1] = cbFashionMinMax[2];
        cbFashionMinMax[2] = 1;
        cbPackagingMinMax[1] = cbPackagingMinMax[2];
        cbPackagingMinMax[2] = 1;
        cbFurnitureMinMax[1] = cbFurnitureMinMax[2];
        cbFurnitureMinMax[2] = 1;
        cbRecreationMinMax[1] = cbRecreationMinMax[2];
        cbRecreationMinMax[2] = 0;
        cbElectricityMinMax[1] = cbElectricityMinMax[2];
        cbElectricityMinMax[2] = 1;
        seElectrRenewMinMax[1] = seElectrRenewMinMax[2];
        seElectrRenewMinMax[2] = 0;

        chbLightMinMax[1] = chbLightMinMax[2];
        chbLightMinMax[2] = true;
        chbWashingMachineMinMax[1] = chbWashingMachineMinMax[2];
        chbWashingMachineMinMax[2] = true;
        chbDryerMinMax[1] = chbDryerMinMax[2];
        chbDryerMinMax[2] = false;
        chbTVSetMinMax[1] = chbTVSetMinMax[2];
        chbTVSetMinMax[2] = true;
        chbVideoMinMax[1] = chbVideoMinMax[2];
        chbVideoMinMax[2] = false;
        chbCableTVMinMax[1] = chbCableTVMinMax[2];
        chbCableTVMinMax[2] = false;
        chbComputerMinMax[1] = chbComputerMinMax[2];
        chbComputerMinMax[2] = false;
        chbRadioMinMax[1] = chbRadioMinMax[2];
        chbRadioMinMax[2] = true;
    }

    public function SetParametersMinMax(MinMax:int, osoby:Array):void {
        /*  I_cbCarAge1:=0;
         I_cbCarFuel1:=0;
         I_cbCarAge2:=0;
         I_cbCarFuel2:=0;
         I_cbCarAge3:=0;
         I_cbCarFuel3:=0;
         var osoba
         I_eCarDistance1:=0; I_chbCarAirCond1:=False; I_cbCarSize1:=0; I_eCarFuelCons1:=6; I_cbCarSharnig1:=4; I_chbCarAirCond1:=False;
         I_eCarDistance2:=0; I_chbCarAirCond2:=False; I_cbCarSize2:=0; I_eCarFuelCons2:=0; I_cbCarSharnig2:=4; I_chbCarAirCond2:=False;
         I_eCarDistance3:=0; I_chbCarAirCond3:=False; I_cbCarSize3:=0; I_eCarFuelCons3:=0; I_cbCarSharnig3:=4; I_chbCarAirCond3:=False;}
         */

        for (var i:int = 0; i < osoby.length; i++) {
            var osoba:Person = osoby[i];

            osoba.flightClass = 0;

            osoba.houseType = cbHomeTypeMinMax[MinMax];
            osoba.buildingMaterial = cbHomeMatMinMax[MinMax];
            osoba.insulation = cbHomeInsulationMinMax[MinMax];
            osoba.livingArea = eHomeAreaMinMax[MinMax];
            osoba.personNumber = eHomePersonsMinMax[MinMax];
            osoba.heatingTemperature = cbHeatTempMinMax[MinMax];
            osoba.heatingSource = cbHeatSourceMinMax[MinMax];
            osoba.ventilationMethod = cbVentillationMethodMinMax[MinMax];
            osoba.heatingRenewableRatio = seHeatRenewMinMax[MinMax];

            osoba.bathNumber = seHotWatersBathsNoMinMax[MinMax];
            osoba.waterBathVolume = cbHotWatersBathsWaterQtyMinMax[MinMax];
            osoba.showerNumber = seHotWatersShowersNoMinMax[MinMax];
            osoba.waterHeatingSystem = cbHotWatersHeatingSystemMinMax[MinMax];

            osoba.acEnabled = chbKlimaMinMax[MinMax];
            osoba.acFrequency = 0;
            osoba.acDuration = 0;
            osoba.acTemp = cbKlimaTempMinMax[MinMax];


            var vehicleData:VehicleSelectedData = osoba.getVehicleData(0);

            vehicleData.vehicleType = cbCarSize1MinMax[MinMax];
            vehicleData.fuelConsumption = eCarFuelCons1MinMax[MinMax];
            vehicleData.passengerFreq = cbCarSharnig1MinMax[MinMax];
            vehicleData.acEnabled = chbCarAirCondMinMax[MinMax];


//            osoba.Pojazd0 = cbCarSize1MinMax[MinMax];
//            osoba.PojazdZuzycie0 = eCarFuelCons1MinMax[MinMax];
//            osoba.PojazdDrugaOsoba0 = cbCarSharnig1MinMax[MinMax];
//            osoba.PojazdKlimatyzacja0 = chbCarAirCondMinMax[MinMax];


            osoba.foodAmount = cbFoodQuantityMinMax[MinMax];
            osoba.foodOrigin = cbFoodOriginMinMax[MinMax];
            osoba.meatConsumption = cbFoodMeatMinMax[MinMax];
            osoba.frozenFood = cbFoodFrozenMinMax[MinMax];
            osoba.fridgeType = cbFridgeMinMax[MinMax];
            osoba.separateFridge = chbFreezerMinMax[MinMax];

            osoba.income = 4;
            osoba.recycling = 1;
            osoba.clothes = cbFashionMinMax[MinMax];
            osoba.packaging = cbPackagingMinMax[MinMax];
            osoba.furnitureElectronics = cbFurnitureMinMax[MinMax];
            osoba.recreation = cbRecreationMinMax[MinMax];
            osoba.electricity = cbElectricityMinMax[MinMax];
            osoba.renewableRatio = seElectrRenewMinMax[MinMax];

            osoba.lighting = chbLightMinMax[MinMax];
            osoba.washingMachineSelected = chbWashingMachineMinMax[MinMax];
            osoba.underwearDryer = chbDryerMinMax[MinMax];
            osoba.tv = chbTVSetMinMax[MinMax];
            osoba.videoDVD = chbVideoMinMax[MinMax];
            osoba.cableTV = chbCableTVMinMax[MinMax];
            osoba.computer = chbComputerMinMax[MinMax];
            osoba.radioHiFi = chbRadioMinMax[MinMax];

            osoba.industrialEmissionReduction = 1;
            osoba.transportEmissionReduction = 1;
        }
    }

    /**Ustalanie wartości parametrów na podstawie stanu kontrolek**/
    public function setParametersFromVis(osoba:Person):void {
//								Mieszkanie


        osoba.houseType = mainApp.mieszkanie_controls.houseType;
        osoba.buildingMaterial = mainApp.mieszkanie_controls.materialType;
        osoba.insulation = mainApp.mieszkanie_controls.insulationType;
        osoba.livingArea = mainApp.mieszkanie_controls.area;
        osoba.personNumber = mainApp.mieszkanie_controls.personNumber;
        osoba.heatingTemperature = mainApp.mieszkanie_controls.heatingTemp;
        osoba.heatingSource = mainApp.mieszkanie_controls.heatingSourceType;
        osoba.ventilationMethod = mainApp.mieszkanie_controls.ventilationMethod;
        osoba.heatingRenewableRatio = mainApp.mieszkanie_controls.renewableRatio;
//								Ciepła woda
        osoba.bathNumber = mainApp.ciepla_woda_controls.bathNumber;
        osoba.waterBathVolume = mainApp.ciepla_woda_controls.bathVolume;
        osoba.showerNumber = mainApp.ciepla_woda_controls.showerNumber;
        osoba.waterHeatingSystem = mainApp.ciepla_woda_controls.heatingSource;

        osoba.acEnabled = mainApp.ciepla_woda_controls.acEnabled;
        osoba.acFrequency = mainApp.ciepla_woda_controls.acFrequency;
        osoba.acDuration = mainApp.ciepla_woda_controls.acDuration;
        osoba.acTemp = mainApp.ciepla_woda_controls.acTemp;
//								Transport prywatny

        var privateTrPanel:PrivateTransportPanel =  mainApp.transport_osobowy_controls;
        var vehicleSelectedData0:VehicleSelectedData = privateTrPanel.createVehicleSelectedData(0);
        var vehicleSelectedData1:VehicleSelectedData = privateTrPanel.createVehicleSelectedData(1);
        var vehicleSelectedData2:VehicleSelectedData = privateTrPanel.createVehicleSelectedData(2);

        osoba.setVehicleData(0,vehicleSelectedData0);
        osoba.setVehicleData(1,vehicleSelectedData1);
        osoba.setVehicleData(2,vehicleSelectedData2);

//								Transport publiczny
        osoba.cityBus = mainApp.transport_publiczny_controls.cityBus;
        osoba.longDistanceBus = mainApp.transport_publiczny_controls.longDistanceBus;
        osoba.miniBus = mainApp.transport_publiczny_controls.miniBus;
        osoba.tramSubway = mainApp.transport_publiczny_controls.tramSubway;
        osoba.suburbanTrain = mainApp.transport_publiczny_controls.suburbanTrain;
        osoba.longDistanceTrain = mainApp.transport_publiczny_controls.longDistanceTrain;
        osoba.taxi = mainApp.transport_publiczny_controls.taxi;
        osoba.flightClass = mainApp.transport_publiczny_controls.flightClass;
        osoba.longDistanceFlights = mainApp.transport_publiczny_controls.longDistanceFlights;
        osoba.shortDistanceFlights = mainApp.transport_publiczny_controls.shortDistanceFlights;
// 								Jedzenie
        osoba.foodAmount = mainApp.zywnosc_controls.foodAmount;
        osoba.foodOrigin = mainApp.zywnosc_controls.foodOrigin;
        osoba.meatConsumption = mainApp.zywnosc_controls.meatConsumption;
        osoba.frozenFood = mainApp.zywnosc_controls.frozenFood;
        /*************        KUCHENKA!!!!!!    *************/
        osoba.fridgeType = mainApp.zywnosc_controls.fridgeType;
        osoba.separateFridge = mainApp.zywnosc_controls.separateFridge;
//								Konsumpcja
        osoba.income = mainApp.konsumpcja_controls.income;
        osoba.recycling = mainApp.konsumpcja_controls.recycling; // Some of my waste is recycled
        osoba.clothes = mainApp.konsumpcja_controls.clothes; // New, >5y
        osoba.packaging = mainApp.konsumpcja_controls.packaging; // I tend to buy things that are nicely packed
        osoba.furnitureElectronics = mainApp.konsumpcja_controls.furnitureElectronic; // I mostly buy  second hand furniture and appliances
        osoba.recreation = mainApp.konsumpcja_controls.recreation; // I prefer medium carbon intensive time spending, e.g. movies or bars
        osoba.electricity = mainApp.konsumpcja_controls.electricity;
        osoba.renewableRatio = mainApp.konsumpcja_controls.renewableRatio;

        osoba.lighting = mainApp.konsumpcja_controls.lighting;
        osoba.washingMachineSelected = mainApp.zywnosc_controls.washingMachineSelected;
        osoba.underwearDryer = mainApp.konsumpcja_controls.underwearDryer;
        osoba.tv = mainApp.konsumpcja_controls.TV;
        osoba.videoDVD = mainApp.konsumpcja_controls.videoDVD;
        osoba.cableTV = mainApp.konsumpcja_controls.cableTV;
        osoba.computer = mainApp.konsumpcja_controls.computer;
        osoba.radioHiFi = mainApp.konsumpcja_controls.radioHiFi;

        osoba.industrialEmissionReduction = IndustrialEmissionReduction.getReduction(mainApp.twoja_emisja_controls.industrialEmissionReduction);
        osoba.transportEmissionReduction = TransportEmissionReduction.getReduction(mainApp.twoja_emisja_controls.transportEmissionReduction);


    }

    /**Ustalanie stanu kontrolek na podstawie parametrów**/
    public function setVisFromParameters(osoba:Person):void {
//								House

        mainApp.mieszkanie_controls.houseType = osoba.houseType;
        mainApp.mieszkanie_controls.materialType = osoba.buildingMaterial;
        mainApp.mieszkanie_controls.insulationType = osoba.insulation;
        mainApp.mieszkanie_controls.area = osoba.livingArea;
        mainApp.mieszkanie_controls.personNumber = osoba.personNumber;
        mainApp.mieszkanie_controls.heatingTemp = osoba.heatingTemperature;
        mainApp.mieszkanie_controls.heatingSourceType = osoba.heatingSource;
        mainApp.mieszkanie_controls.ventilationMethod = osoba.ventilationMethod;
        mainApp.mieszkanie_controls.renewableRatio = osoba.heatingRenewableRatio;

//								Warm water

        mainApp.ciepla_woda_controls.bathNumber = osoba.bathNumber;
        mainApp.ciepla_woda_controls.bathVolume = osoba.waterBathVolume;
        mainApp.ciepla_woda_controls.showerNumber = osoba.showerNumber;
        mainApp.ciepla_woda_controls.heatingSource = osoba.waterHeatingSystem;

        mainApp.ciepla_woda_controls.acEnabled = osoba.acEnabled;
        //Wywołujemy chowanie lub pokazanie klimatyzacji
        mainApp.ciepla_woda_controls.acRefresh();
        osoba.acEnabled = false;
        mainApp.ciepla_woda_controls.acTemp = osoba.acTemp;
        mainApp.ciepla_woda_controls.acDuration = osoba.acDuration;
        mainApp.ciepla_woda_controls.acFrequency = osoba.acFrequency;


//								Private transport

        var vehicleSelectedData0:VehicleSelectedData = osoba.getVehicleData(0);
        var vehicleSelectedData1:VehicleSelectedData = osoba.getVehicleData(1);
        var vehicleSelectedData2:VehicleSelectedData = osoba.getVehicleData(2);

        var privateTransportPanel:PrivateTransportPanel = mainApp.transport_osobowy_controls;

        privateTransportPanel.changeViewFromParameters(vehicleSelectedData0, 0);
        privateTransportPanel.changeViewFromParameters(vehicleSelectedData1, 1);
        privateTransportPanel.changeViewFromParameters(vehicleSelectedData2, 2);

//								Public transport

        mainApp.transport_publiczny_controls.cityBus = osoba.cityBus;
        mainApp.transport_publiczny_controls.longDistanceBus = osoba.longDistanceBus;
        mainApp.transport_publiczny_controls.miniBus = osoba.miniBus;
        mainApp.transport_publiczny_controls.tramSubway = osoba.tramSubway;
        mainApp.transport_publiczny_controls.suburbanTrain = osoba.suburbanTrain;
        mainApp.transport_publiczny_controls.longDistanceTrain = osoba.longDistanceTrain;
        mainApp.transport_publiczny_controls.taxi = osoba.taxi;
        mainApp.transport_publiczny_controls.flightClass = osoba.flightClass;

        if (osoba.longDistanceFlights == 0) {
            mainApp.transport_publiczny_controls.longDistanceFlights = 0;
        }
        else {
            mainApp.transport_publiczny_controls.longDistanceFlights = osoba.longDistanceFlights;
        }

        if (osoba.shortDistanceFlights == 0) {
            mainApp.transport_publiczny_controls.shortDistanceFlights = 0;
        }
        else {
            mainApp.transport_publiczny_controls.shortDistanceFlights = osoba.shortDistanceFlights;
        }

// 								Food

        mainApp.zywnosc_controls.foodAmount = osoba.foodAmount;
        mainApp.zywnosc_controls.foodOrigin = osoba.foodOrigin;
        mainApp.zywnosc_controls.meatConsumption = osoba.meatConsumption;
        mainApp.zywnosc_controls.frozenFood = osoba.frozenFood;

        /*************        Cooker!!!!!!    *************/
        mainApp.zywnosc_controls.fridgeType = osoba.fridgeType;
        mainApp.zywnosc_controls.separateFridge = osoba.separateFridge;


//								Consumption


        mainApp.konsumpcja_controls.income = osoba.income;
        mainApp.konsumpcja_controls.recycling = osoba.recycling;


        mainApp.konsumpcja_controls.clothes = osoba.clothes;
        mainApp.konsumpcja_controls.packaging = osoba.packaging;
        mainApp.konsumpcja_controls.furnitureElectronic = osoba.furnitureElectronics;


        mainApp.konsumpcja_controls.recreation = osoba.recreation;
        mainApp.konsumpcja_controls.electricity = osoba.electricity;
        mainApp.konsumpcja_controls.renewableRatio = osoba.renewableRatio;

        mainApp.konsumpcja_controls.lighting = osoba.lighting;
        mainApp.zywnosc_controls.washingMachineSelected = osoba.washingMachineSelected;
        mainApp.konsumpcja_controls.underwearDryer = osoba.underwearDryer;
        mainApp.konsumpcja_controls.TV = osoba.tv;
        mainApp.konsumpcja_controls.videoDVD = osoba.videoDVD;
        mainApp.konsumpcja_controls.cableTV = osoba.cableTV;
        mainApp.konsumpcja_controls.computer = osoba.computer;
        mainApp.konsumpcja_controls.radioHiFi = osoba.radioHiFi;



//							Rzeczywistość alternatywna
        mainApp.twoja_emisja_controls.industrialEmissionReduction = 0;
        mainApp.twoja_emisja_controls.transportEmissionReduction = 0;

        //DisplayCalcMode = true;

        /*****************************************************************************
         *         Wywołanie funkcji odpowiedzialnych za odkrywanie kontrolek             *
         *****************************************************************************/
        if (osoba.acEnabled) {
            mainApp.ciepla_woda_controls.acEnabled = true
        }



        if (privateTransportPanel.getSelectedVehicleType(0) != VehicleType.NONE) {
            privateTransportPanel.changeVehicleView(0);
        }
        if (privateTransportPanel.getSelectedVehicleType(1) != VehicleType.NONE) {
            privateTransportPanel.changeVehicleView(1);
        }
        if (privateTransportPanel.getSelectedVehicleType(2) != VehicleType.NONE) {
            privateTransportPanel.changeVehicleView(2);
        }


    }
}
}

